package com.intelligent.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;

/**
 * 供应商对账明细表
 * @TableName supplier_reconciliation_detail
 */
@TableName(value ="supplier_reconciliation_detail")
@Data
public class SupplierReconciliationDetail implements Serializable {
    /**
     *
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 关联对账单主表
     */
    private Long reconciliationId;

    /**
     * 关联采购订单
     */
    private Long purchaseOrderId;

    /**
     * 关联收货单
     */
    private Integer goodsReceiptId;

    /**
     * 关联付款单
     */
    private Long paymentOrderId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SupplierReconciliationDetail other = (SupplierReconciliationDetail) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getReconciliationId() == null ? other.getReconciliationId() == null : this.getReconciliationId().equals(other.getReconciliationId()))
            && (this.getPurchaseOrderId() == null ? other.getPurchaseOrderId() == null : this.getPurchaseOrderId().equals(other.getPurchaseOrderId()))
            && (this.getGoodsReceiptId() == null ? other.getGoodsReceiptId() == null : this.getGoodsReceiptId().equals(other.getGoodsReceiptId()))
            && (this.getPaymentOrderId() == null ? other.getPaymentOrderId() == null : this.getPaymentOrderId().equals(other.getPaymentOrderId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getReconciliationId() == null) ? 0 : getReconciliationId().hashCode());
        result = prime * result + ((getPurchaseOrderId() == null) ? 0 : getPurchaseOrderId().hashCode());
        result = prime * result + ((getGoodsReceiptId() == null) ? 0 : getGoodsReceiptId().hashCode());
        result = prime * result + ((getPaymentOrderId() == null) ? 0 : getPaymentOrderId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", reconciliationId=").append(reconciliationId);
        sb.append(", purchaseOrderId=").append(purchaseOrderId);
        sb.append(", goodsReceiptId=").append(goodsReceiptId);
        sb.append(", paymentOrderId=").append(paymentOrderId);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
